package ch9;

public class Zxf2 {
    public static void main(String[] args) {
        int[] a = new int[10];
        int b;
        for (int i = 0; i < a.length; i++) {
            a[i] = (i + 1) * (i + 1);
            //System.out.println(a[i]);
        }
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a.length - i - 1; j++) {
                if (a[j] < a[j + 1]) {
                    b = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = b;
                }

            }
        }
        System.out.print("排序 ");
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "  ");
        }

    }

}

